"""add v3pic update legth

Revision ID: c5f41f984bbc
Revises: 0b0cb42f4cc2
Create Date: 2024-05-06 10:55:55.655884

"""
from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql

# revision identifiers, used by Alembic.
revision: str = 'c5f41f984bbc'
down_revision: Union[str, None] = '0b0cb42f4cc2'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('v3pic',
    sa.Column('id', sa.BigInteger(), nullable=False),
    sa.Column('name', sa.VARCHAR(length=255), nullable=True, comment='name'),
    sa.Column('level', sa.VARCHAR(length=255), nullable=True, comment='level'),
    sa.Column('style', sa.VARCHAR(length=255), nullable=True, comment='style'),
    sa.Column('lang', sa.VARCHAR(length=255), nullable=True, comment='style'),
    sa.Column('pic_type', sa.VARCHAR(length=255), nullable=True, comment='style'),
    sa.Column('wordlib', sa.VARCHAR(length=255), nullable=True, comment='style'),
    sa.Column('collection', sa.VARCHAR(length=255), nullable=True, comment='style'),
    sa.Column('answer_text', sa.VARCHAR(length=255), nullable=True, comment='style'),
    sa.Column('answer_location', sa.VARCHAR(length=255), nullable=True, comment='style'),
    sa.Column('prefix_path', sa.VARCHAR(length=255), nullable=True, comment='style'),
    sa.PrimaryKeyConstraint('id')
    )
    op.alter_column('share_data', 'source_share_link',
               existing_type=mysql.TEXT(),
               nullable=True,
               existing_comment='来源地址')
    # ### end Alembic commands ###


def downgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.alter_column('share_data', 'source_share_link',
               existing_type=mysql.TEXT(),
               nullable=False,
               existing_comment='来源地址')
    op.drop_table('v3pic')
    # ### end Alembic commands ###
